﻿@{
    IEnumerable<Vit.Web.Mvc.DataAnnotations.OperationAttribute> operations = ViewData["Operations"] as IEnumerable<Vit.Web.Mvc.DataAnnotations.OperationAttribute>;
}
@if (operations != null)
{
    <ul>
        @foreach (var item in operations)
        {
            if (MenuHelper.CanCurrentUserAccess(item.PermissionPattern))
            {
            <li><a href="@(Vit.Web.Extensions.ObjectExtenstions.FormatWithProperies(ViewData.Model, item.LinkUrlPattern))" class="@item.CssClass" @item.HtmlAttributes>
                @if (!string.IsNullOrEmpty(item.ImageUrl))
                {
                    <img src="@Theme.Image(item.ImageUrl)" alt=""/>
                }
                <span>@Locale.GetString(ViewData.Model, item.OperationName)</span> </a>
            </li>
            }
        }
    </ul>
}
